package com.wirelesshomecontrol.gui.windows;

import com.vaadin.terminal.Sizeable;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.PopupView;
import com.vaadin.ui.ProgressIndicator;
import com.vaadin.ui.Window;

@SuppressWarnings("serial")
public class SearchingWindow {

	static final Label SEARCHING = new Label("Searching for Modules...");
	public ProgressIndicator pi = new ProgressIndicator();
	
	private Window searchingWindow = new Window();
	private GridLayout grid = new GridLayout(3,2);
	//Window searchingWindow = new Window();

	
	public SearchingWindow(){
		//Searching Window Init
		initSearchingWindow();
	}

	@SuppressWarnings("deprecation")
	private void initSearchingWindow(){
		grid.setWidth(400, Sizeable.UNITS_PIXELS);
		grid.setHeight(100,Sizeable.UNITS_PIXELS);
		pi.addStyleName("big");
		pi.setIndeterminate(true);
		searchingWindow.setCaption("Searching");
		searchingWindow.setPositionX(100);
		searchingWindow.setPositionY(100);
		searchingWindow.setWidth(400, Sizeable.UNITS_PIXELS);
		searchingWindow.setHeight(150, Sizeable.UNITS_PIXELS);
		grid.addComponent(SEARCHING,1,0);
		grid.setComponentAlignment(SEARCHING, "middle center");
		grid.addComponent(pi,1,1);
		grid.setComponentAlignment(pi, "top center");
		searchingWindow.addComponent(grid);
	}

	public void setSearchingWindow(Window searchingWindow) {
		this.searchingWindow = searchingWindow;
	}

	public Window getSearchingWindow() {
		return searchingWindow;
	}

}


